using Nop.Core.Domain.Customers;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nop.Data.Mapping.Customers
{
	public class ClubMembershipHistoryMap : EntityTypeConfiguration<ClubMembershipHistory>
	{
		public ClubMembershipHistoryMap()
		{
			this.ToTable("ClubMembershipHistory");
			this.HasKey(cm => cm.Id);

			this.HasRequired(cm => cm.ClubMembership).WithMany().HasForeignKey(cm => cm.MembershipId);
			this.HasRequired(cm => cm.Customer).WithMany().HasForeignKey(cm => cm.CustomerId);

			this.Property(cm => cm.CreatedDateTime).IsRequired();
		}
	}
}
